﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Vinetlife.Master" AutoEventWireup="true" CodeBehind="TransactionHistory.aspx.cs" Inherits="VINETLIFE.Customers.TransactionHistory" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="/Module/ucVnLeftCustomerMenu.ascx" TagName="ucVnLeftCustomerMenu" TagPrefix="uc1" %>
<%@ Register Src="/Module/ucVnAccountInfo.ascx" TagName="ucVnAccountInfo" TagPrefix="uc2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="main-container-inner">
        <div class="main-container-inner">
            <div id="breadcrumb">
                <ul class="crumbs">
                    <li class="first"><a href="/" style="z-index: 9;" title="Trang chủ"><span></span>Trang chủ</a></li>
                    <li><a href="/trang-ca-nhan/" style="z-index: 8;">Trang cá nhân</a></li>
                    <li><a href="/lich-su-giao-dich/" style="z-index: 7;">Lịch sử giao dịch</a></li>
                </ul>
            </div>
            <div class="t-content-wrap">
                <div class="main-container-inner-left">
                    <uc1:ucVnLeftCustomerMenu ID="ucVnLeftCustomerMenu1" runat="server" />
                </div>
                <div class="main-container-inner-right">
                    <uc2:ucVnAccountInfo ID="ucVnAccountInfo1" runat="server" />
                    <div class="margin-20">
                    </div>
                    <style>
                        
                    </style>
                    <div class="tranhis-search-wrap">
                        <div class="tranhis-search-inner-right">
                            <div class="tranhis-search-inner-type">
                                <span class="tranhis-lable-content">Loại giao dịch</span>
                                <span class="tranhis-lable-contentr">
                                <asp:DropDownList runat="server" ID="ddlAccountTranType" AppendDataBoundItems="true" DataValueField="AccountTranMethodCode" DataTextField="AccountTranMethod" CssClass="ddl-input">
                                    <asp:ListItem Text=" .: Chọn toàn bộ :. " Value=""></asp:ListItem>
                                </asp:DropDownList>
                                    </span>
                            </div>
                            <div class="tranhis-search-inner-date">
                                <table class="tranhis-table">
                                    <tr>
                                        <td class="tranhist-tdl">
                                            <span class="tranhis-lable-content">Chọn thời gian        
                                            </span>
                                            <span class="tranhis-lable-contentr">
                                                <asp:RadioButton runat="server" ID="rdSearchDate" GroupName="grpPurchase" Text="Ngày chính xác" Checked="true" />
                                                <asp:RadioButton runat="server" ID="rdFromDate" GroupName="grpPurchase" Text="Khoảng thời gian" />
                                            </span>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                            <div class="tranhis-search-inner-date">
                                <table class="tranhis-table">
                                    <tr>
                                        <td class="tranhist-tdr">
                                            <div id="dthsearchdate" class="dth-searchdate">
                                                <span class="tranhis-lable-date">Chọn ngày</span>
                                                <asp:TextBox runat="server" ID="txtSearchDate" CssClass="dth-input"></asp:TextBox>
                                                <cc1:CalendarExtender runat="server" ID="X" TargetControlID="txtSearchDate" Format="dd/MM/yyyy"></cc1:CalendarExtender>
                                            </div>
                                            <div id="dthfromdate" style="display: none;" class="dth-searchdate">
                                                <div class="dth-search-from-date">
                                                    <span class="tranhis-lable-date">Từ ngày</span>
                                                    <asp:TextBox runat="server" ID="txtFromDate" CssClass="dth-input" Width="100px"></asp:TextBox>
                                                    <cc1:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="txtFromDate" Format="dd/MM/yyyy"></cc1:CalendarExtender>
                                                </div>
                                                <div class="dth-search-to-date">
                                                     <span class="tranhis-lable-date">Tới ngày</span>
                                                    <asp:TextBox runat="server" ID="txtToDate" CssClass="dth-input" Width="100px"></asp:TextBox>
                                                    <cc1:CalendarExtender runat="server" ID="CalendarExtender2" TargetControlID="txtToDate" Format="dd/MM/yyyy"></cc1:CalendarExtender>
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td></td>
                                    </tr>
                                </table>
                            </div>
                            <div class="tranhis-search-inner-search">
                                <asp:Button runat="server" ID="btnSearch" style="float:right;" Text="Tìm kiếm" OnClick="btnSearch_Click" CssClass="btnLogin" />
                            </div>
                        </div>
                    </div>
                    <div class="tranhis-wrap">
                        <h4>Danh sách giao dịch</h4>
                        <asp:GridView ID="grvLogAccount" DataKeyNames="LogAccountId" runat="server" AutoGenerateColumns="False"
                            PageSize="50" CssClass="tstyle2" Width="100%" PagerStyle-CssClass="pgr" AllowPaging="true"
                            OnPageIndexChanging="grvLogAccount_PageIndexChanging">
                            <Columns>
                                <asp:TemplateField HeaderText="#" ItemStyle-Width="30px" ItemStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <%# Container.DataItemIndex + 1 %>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="CreatedDate" DataFormatString="{0:dd/MM/yyyy hh:mm tt}" HeaderText="Ngày giao dịch" ItemStyle-Width="120px" />
                                <asp:TemplateField HeaderText="Nội dung" ItemStyle-Width="200px" >
                                    <ItemTemplate>
                                        <div class="t-ul-content-logaacount">
                                            <%#Eval("Content") %>
                                        </div>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="DepositBeforeTran" HeaderText="Số dư trước giao dịch" DataFormatString="{0:#,##} đ" ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Center"/>
                                <asp:BoundField DataField="CurrentDeposite" HeaderText="Số dư sau giao dịch" DataFormatString="{0:#,##} đ" ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Center"/>
                                <asp:BoundField DataField="AccountTransactionMethod" HeaderText="Loại giao dịch" ItemStyle-Width="100px" />
                                <asp:BoundField DataField="InvoiceNumber" HeaderText="Mã đơn hàng" ItemStyle-Width="50px" ItemStyle-HorizontalAlign="Center"></asp:BoundField>
                            </Columns>
                            <EmptyDataTemplate>
                                <p>Chưa có giao dịch nào được thực hiện</p>
                            </EmptyDataTemplate>
                        </asp:GridView>
                    </div>
                </div>
            </div>
        </div>
    </div>

     <script type="text/javascript">

         $(window).load(function () {

             var searchDate = $('[id$=rdSearchDate]').is(':checked');
             var fromDate = $('[id$=rdFromDate]').is(':checked');



             if (searchDate) {
                 $('#dthsearchdate').css('display', 'block');
                 $('#dthfromdate').css('display', 'none');
             }

             if (fromDate) {
                 $('#dthsearchdate').css('display', 'none');
                 $('#dthfromdate').css('display', 'block');
             }
         });
   </script>
</asp:Content>
